/*   1:    */ package com.atomikos.icatch.jta;
/*   2:    */ 
/*   3:    */ import com.atomikos.util.SerializableObjectFactory;
/*   4:    */ import java.io.Serializable;
/*   5:    */ import javax.naming.NamingException;
/*   6:    */ import javax.naming.Reference;
/*   7:    */ import javax.naming.Referenceable;
/*   8:    */ import javax.transaction.HeuristicMixedException;
/*   9:    */ import javax.transaction.HeuristicRollbackException;
/*  10:    */ import javax.transaction.NotSupportedException;
/*  11:    */ import javax.transaction.RollbackException;
/*  12:    */ import javax.transaction.SystemException;
/*  13:    */ import javax.transaction.TransactionManager;
/*  14:    */ import javax.transaction.UserTransaction;
/*  15:    */ 
/*  16:    */ public class J2eeUserTransaction
/*  17:    */   implements UserTransaction, Serializable, Referenceable
/*  18:    */ {
/*  19:    */   private static final long serialVersionUID = -7656447860674832182L;
/*  20:    */   private transient TransactionManager txmgr_;
/*  21:    */   
/*  22:    */   private void checkSetup()
/*  23:    */   {
/*  24: 76 */     this.txmgr_ = TransactionManagerImp.getTransactionManager();
/*  25: 78 */     if (this.txmgr_ == null) {
/*  26: 79 */       throw new RuntimeException("Transaction Service Not Running?");
/*  27:    */     }
/*  28:    */   }
/*  29:    */   
/*  30:    */   public void begin()
/*  31:    */     throws NotSupportedException, SystemException
/*  32:    */   {
/*  33: 89 */     checkSetup();
/*  34: 90 */     this.txmgr_.begin();
/*  35:    */   }
/*  36:    */   
/*  37:    */   public void commit()
/*  38:    */     throws RollbackException, HeuristicMixedException, HeuristicRollbackException, SystemException, IllegalStateException, SecurityException
/*  39:    */   {
/*  40:103 */     checkSetup();
/*  41:104 */     this.txmgr_.commit();
/*  42:    */   }
/*  43:    */   
/*  44:    */   public void rollback()
/*  45:    */     throws IllegalStateException, SystemException, SecurityException
/*  46:    */   {
/*  47:114 */     checkSetup();
/*  48:115 */     this.txmgr_.rollback();
/*  49:    */   }
/*  50:    */   
/*  51:    */   public void setRollbackOnly()
/*  52:    */     throws IllegalStateException, SystemException
/*  53:    */   {
/*  54:125 */     checkSetup();
/*  55:126 */     this.txmgr_.setRollbackOnly();
/*  56:    */   }
/*  57:    */   
/*  58:    */   public int getStatus()
/*  59:    */     throws SystemException
/*  60:    */   {
/*  61:135 */     checkSetup();
/*  62:136 */     return this.txmgr_.getStatus();
/*  63:    */   }
/*  64:    */   
/*  65:    */   public void setTransactionTimeout(int seconds)
/*  66:    */     throws SystemException
/*  67:    */   {
/*  68:145 */     checkSetup();
/*  69:146 */     this.txmgr_.setTransactionTimeout(seconds);
/*  70:    */   }
/*  71:    */   
/*  72:    */   public Reference getReference()
/*  73:    */     throws NamingException
/*  74:    */   {
/*  75:157 */     return SerializableObjectFactory.createReference(this);
/*  76:    */   }
/*  77:    */ }


/* Location:           C:\myfile\mysoft\apache-maven-3.5.0-bin\apache-maven-3.5.0\myrep\com\atomikos\transactions-jta\3.7.0\transactions-jta-3.7.0.jar
 * Qualified Name:     com.atomikos.icatch.jta.J2eeUserTransaction
 * JD-Core Version:    0.7.0.1
 */